<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1">
    <link rel="shortcut icon" href="/favicon.ico">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <title th:text="登录-职工互助保障系统企业端"></title>
    <meta name="viewport"
          content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <!-- 设置浏览器图标 -->
    <link rel="shortcut icon" href="/favicon.ico">
    <script src="../static/plugin/jquery/jquery.min.js"></script>
    <script src="../static/plugin/jquery-validation/1.14.0/jquery.validate.js"></script>
    <!-- 引入自定义文件 -->
    <link href="../static/css/style.css" rel="stylesheet"/>
    <script th:inline="javascript"> var ctx = [[@{/}]]; var captchaType = [[${captchaType}]]; </script>
    <script src="https://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js"></script>
    <script>
        if (window.top !== window.self) {
            window.top.location = window.location;
        }
    </script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#loginForm").validate({
                rules: {
                    validateCode: {remote: "/servlet/validateCodeServlet"}
                },
                messages: {
                    username: {required: "请填写用户名."}, password: {required: "请填写密码."},
                    validateCode: {remote: "验证码不正确.", required: "请填写验证码."}
                },
                errorLabelContainer: "#messageBox",
                errorPlacement: function (error, element) {
                    error.appendTo($("#loginError").parent());
                }
            });
        });
        // 如果在框架或在对话框中，则弹出提示并跳转到首页
        if (self.frameElement && self.frameElement.tagName == "IFRAME" || $('#left').length > 0) {
            alert('未登录或登录超时。请重新登录，谢谢！');
            top.location = "/a";
        }
    </script>

    <style>
        * {
            padding: 0;
            margin: 0;
        }

        a {
            color: #282828;
        }

        .header {
            height: 150px;
            background: url("../static/platform/resource/img/bg1.png") center center;
            display: flex;
        }

        .header > .header-left {
            background: url("../static/platform/resource/img/logo_qyd.png") no-repeat center center;
            flex: 1;
        }

        .header > .header-right {
            background: url("../static/platform/resource/img/yxfw.png") no-repeat center center;
            flex: 1;
        }

        .body {
            height: 630px;
            background: url("../static/platform/resource/img/bg2.png") no-repeat center center #f7f7f7;
        }

        .content {
            margin: 0px auto;
            width: 1200px;
            display: flex;
            position: relative;
        }

        .body-left {
            flex: 1;
        }

        .body-right {
            flex: 1;
        }

        .right-con span {
            padding: 10px 20px;
            background: #41c1f5;
            border-radius: 5px;
            color: #fff;
            font-size: 18px;
        }

        .right-con {
            width: 440px;
            margin: 80px 30px 0px 30px;
        }

        .right-con ul {
            margin: 20px 10px;
        }

        .right-con ul li {
            line-height: 45px;
            border-bottom: dashed 1px #333;
            color: #282828;
            list-style: square url("../static/platform/resource/img/li.png");
        }

        .distryForm form {
            width: 440px;
            min-height: 350px;
            background-color: #fff;
            margin: 80px 30px;
            display: flex;
            flex-direction: column;
            border: solid 1px #eaebee;
        }

        .form {
            margin: 0 25px;
            flex: 1;
        }

        .form-title {
            background-color: #f2f4f8;
            color: #334262;
            font-size: 20px;
            text-align: center;
            line-height: 75px;
            display: flex;
        }

        .form-title span {
            flex: 1
        }

        .span-active {
            color: #41c1f6;
            border-bottom: solid 1px #41c1f6;
        }

        .form-user {
            background: url("../static/image/user.png") no-repeat center left;
            border-bottom: 1px #7b8598 solid;
        }

        input {
            margin: 25px;
            border: 0;
            font-size: 16px;
            outline: none;
        }

        .form-password {
            background: url("../static/image/lock.png") no-repeat center left;
            border-bottom: 1px #7b8598 solid;
        }

        .form-code {
            background: url("../static/image/code.png") no-repeat center left;
            border-bottom: 1px #7b8598 solid;
            position: relative;
        }

        .form-code img {
            width: 100px;
            height: 40px;
            position: absolute;
            right: 0;
            top: 15px;
            background-color: red;
        }

        .autoRegister {
            color: #757575;
            font-size: 15px;
            position: relative;
            margin-top: 10px;
        }

        .autoRegister h3 {
            color: #ad1829;
            text-align: center;
        }

        .checkbox {
            margin: 0;
        }

        .autoRegister .forget {
            position: absolute;
            right: 0;
            text-decoration: none;
            color: #757575;
        }

        /*忘记密码*/
        .autoRegister .forget:hover {
            color: #3c3c3c;
        }

        .button {
            width: 100%;
            font-size: 15px;
            border-radius: 5px;
            cursor: pointer;
        }

        .login .button {
            background-color: #41c1f5;
            height: calc(100% - 20px);
            min-height: 45px;
            margin-bottom: 20px;
            color: #fff;
            border: 0;
        }

        .register .button {
            height: calc(100% - 20px);
            margin-bottom: 20px;
            border: 1px #b71112 solid;
            background-color: #fff;
            color: #b71112;
        }

        .footer {
            height: 150px;
            border-top: solid 2px #41c1f5;
            text-align: center;
            line-height: 25px;
            color: #fff;
            font-size: 14px;
        }

        .footer-con {
            width: 1200px;
            margin: 0px auto;
            display: flex;
        }

        .con-left {
            flex: 1;
            text-align: left;
        }

        .con-left a {
            color: #41c1f6;
        }

        .con-right {
            flex: 1;
            text-align: center;
        }

        .footer .download {
            text-decoration: none;
            color: #000;
        }

        .footer .download:hover {
            color: #0000ff;
        }

        a {
            text-decoration: none;
        }
    </style>
</head>


<body>
<!--头-->
<div class="header">
    <div class="header-left"></div>
    <div class="header-right"></div>
</div>
<!--身体-->
<div class="body">
    <div class="content">
        <div class="body-left">
            <div class="distryForm">
                <div class="form-title">
                    <span id="smdl" class="span-active">扫码登录</span>
                    <span id="mmdl">密码登录</span>
                </div>
                <div id="smdl-pan" style="height:327px;text-align:center;">
                    <div id="weChateImg" style="height:280px;">
                        <!-- 二维码 -->
                    </div>
                    <div class="form autoRegister" style="text-align:left;">
                        <a href="/Member">账号注册</a>
                        <a href="/getPassword" class="forget">忘记密码</a>
                    </div>
                </div>
                <form id="signupForm" autocomplete="off">
                <div id="mmdl-pan" style="display:none;">
                    <div class="form form-user">
                        <!--oninput="userHideShow()"-->
                        <input type="text"  name="account" id="account" placeholder="单位账号">
                        <span style="color: #ad1829" hidden="hidden" id="userspan">单位账号不能为空！</span>
                    </div>
                    <div class="form form-password">
                        <!--oninput="passHideShow()"-->
                        <input type="password"  name="password" id="password"
                               placeholder="密码">
                        <span style="color: #ad1829" hidden="hidden" id="passpan">密码不能为空！</span>
                    </div>
                    <div class="form form-code">
                        <!--oninput="codeHideShow()"-->
                        <input type="text" id="validateCode" name="validateCode"
                               placeholder="验证码"/>
                        <img th:src="@{/captcha/captchaImage(type=${captchaType})}" class="imgcode" alt="点击更换验证码"
                             onclick="javascript:void(0);"/>
                    </div>
                    <div class="form autoRegister">
                        <a href="/showMember">账号注册</a>
                        <a href="/getUnitPassword" class="forget">忘记密码</a>
                        <h3 hidden="hidden" id="loginspan">单位账号或密码错误！</h3>
                    </div>
                    <div class="form login">

                        <button type="button" class="button" style="height:30px;" onclick="login()" id="btnSubmit" data-loading="正在验证登录，请稍后...">登录</button>

                    </div>
                </div>
                </form>
            </div>
        </div>
        <div class="body-right">
            <div class="right-con">
                <a href="/hzhelp/question/category?type=0">
                    <div class="right-title">
                        <span>政策法规</span>
                    </div>
                </a>
                <ul>
                    <c:forEach items="${questions}" var="question" varStatus="status">
                        <c:if test="${status.index < 4}">
                            <li>
                                <a href="/hzhelp/question/questionDetail?id=${question.id}"></a>
                            </li>
                        </c:if>
                    </c:forEach>
                </ul>
            </div>
            <div class="right-con" style="margin-top:20px;">
                <a href="/hzhelp/question/category?type=2">
                    <div class="right-title">
                        <span>资料下载</span>
                    </div>
                </a>
                <ul>
                    <c:forEach items="${downloads}" var="question" varStatus="status">
                        <c:if test="${status.index < 4}">
                            <li>
                                <a href="/hzhelp/question/questionDetail?id=${question.id}"></a>
                            </li>
                        </c:if>
                    </c:forEach>
                </ul>
            </div>
        </div>
        <div class="body-bottom">
        </div>
    </div>
</div>
<!--脚-->
<div class="footer">
    <div class="footer-con">
        <div class="con-left">
            <div style="margin-left:100px;width:500px;color:#333333;">
                <span style="padding:8px;"><a target="_blank" href="http://www.nmghzb.cn/">官方网站</a></span>
                |<span style="padding:8px;"><a
                    href="/hzhelp/question/category?recommend=1&menuName=helpCenter">帮助中心</a></span>
                <div>
					<span>
				    主办：内蒙古职工互助保障协会   联系电话：0471-5222866 <br>
				    地址：呼和浩特赛罕区腾飞南路28号如意大厦A座<br>
				    建议使用google、Firefox、IE9以上浏览器
				    </span>

                </div>
            </div>
        </div>
        <div class="con-right">
            <div style="width:200px;margin:20px;">
                <div style="width:20px;float:left;color:#41c1f6;line-height:20px;">
                    微信公众号
                </div>
                <div style="float:left;"><img src="../static/platform/resource/img/wx.png" width="100px"
                                              height="100px"></div>
            </div>
        </div>
    </div>
</div>
<!-- 全局js -->
<script src="../static/js/jquery.min.js" th:src="@{/js/jquery.min.js}"></script>
<script src="../static/js/bootstrap.min.js" th:src="@{/js/bootstrap.min.js}"></script>
<!-- 验证插件 -->
<script src="../static/ajax/libs/validate/jquery.validate.min.js" th:src="@{/ajax/libs/validate/jquery.validate.min.js}"></script>
<script src="../static/ajax/libs/validate/messages_zh.min.js" th:src="@{/ajax/libs/validate/messages_zh.min.js}"></script>
<script src="../static/ajax/libs/layer/layer.min.js" th:src="@{/ajax/libs/layer/layer.min.js}"></script>
<script src="../static/ajax/libs/blockUI/jquery.blockUI.js" th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>
<script src="../static/ruoyi/js/ry-ui.js" th:src="@{/ruoyi/js/ry-ui.js?v=4.6.2}"></script>
<script src="../static/ruoyi/login.js" th:src="@{/ruoyi/login.js}"></script>
<script>
    var obj = new WxLogin({
        self_redirect: false,
        id: "weChateImg",//要显示的地址
        appid: "wx6d3bdf8f76b1efd6",
        scope: "snsapi_login",
        redirect_uri: encodeURIComponent("https://sys.nmghzb.cn/f/weChatUnitLogin/weChatUnitInfo"),
        state: Math.ceil(Math.random() * 1000),
        style: "black",
        href: "data:text/css;base64,LmltcG93ZXJCb3ggLnFyY29kZSB7d2lkdGg6IDIwMHB4O30KLmltcG93ZXJCb3ggLnRpdGxlIHtkaXNwbGF5OiBub25lO30KLmltcG93ZXJCb3ggLmluZm8ge3dpZHRoOiAyMTBweDt9Ci5pbXBvd2VyQm94IC5pY29uMzhfbXNnLnN1Y2Mge2Rpc3BsYXk6IG5vbmV9Ci5pbXBvd2VyQm94IC5pY29uMzhfbXNnLndhcm4ge2Rpc3BsYXk6IG5vbmV9Ci5pbXBvd2VyQm94IC5zdGF0dXMge3RleHQtYWxpZ246IGNlbnRlcjt9Cg=="
    });


    function tabChange(id) {
        $("#mmdl").removeClass("span-active");
        $("#smdl").removeClass("span-active");
        $('#' + id).addClass("span-active");

        $('#mmdl-pan').hide();
        $('#smdl-pan').hide();
        $('#' + id + '-pan').show();
    }

    $("#mmdl").click(function () {
        tabChange("mmdl");
    });
    $("#smdl").click(function () {
        tabChange("smdl");
    });


    // $(function () {
    //
    //     //用户名，密码为空不可点击登录
    //     var userflag = false;
    //     var passflag = false;
    //     var codeflag = false;
    //     // $("#login").attr("disabled",true);
    //     $("#login").click(function () {
    //         var account = $("#account").val();
    //         var password = $("#password").val();
    //         var validateCode = $("#validateCode").val();
    //         var rememberMe = $("#rememberMe").val();
    //         if (account == '' || account == null) {
    //             $("#userspan").show();
    //         } else {
    //             userflag = true;
    //         }
    //         if (password == '' || password == null) {
    //             $("#passpan").show();
    //         } else {
    //             passflag = true;
    //         }
    //         if (userflag && passflag) {
    //             if (validateCode == '' || validateCode == null) {
    //                 $("#loginspan").html("请输入验证码！");
    //                 $("#loginspan").show();
    //             } else {
    //                 $.ajax({
    //                     url: '/frontcode/checkcode',
    //                     type: 'get',
    //                     dataType: "json",
    //                     async: false,
    //                     data: {"code": validateCode},
    //                     success: function (data) {
    //                         if (data.flag) {//验证码通过
    //                             codeflag = true;
    //                             login();
    //                         } else {//验证码不通过
    //                             codeflag = false;
    //                             $("#loginspan").html(data.msg);
    //                             $("#loginspan").show();
    //                         }
    //                     },
    //                     error: function () {
    //                         $("#loginspang").html("系统内部错误！");
    //                         $("#loginspan").show();
    //                     }
    //                 });
    //             }
    //
    //         }
    //
    //         //登录提交
    //         function login() {
    //             $("#userspan").hide();
    //             $("#passpan").hide();
    //             $("#loginspan").hide();
    //             userflag = false;
    //             passflag = false;
    //             $.ajax({
    //                 url: '/unit/login',
    //                 type: 'post',
    //                 data: {
    //                     "account": account,
    //                     "password": password,
    //                     "validateCode": validateCode,
    //                     "rememberMe": rememberMe
    //                 },
    //                 dataType: 'json',
    //                 async: false,
    //                 success: function (data) {
    //                     var flag = data.success;//登陆成功
    //                     var msg = data.msg;//登录信息
    //                     if (flag) {
    //                         window.location.href = "/unit/index";
    //                         /* if(msg == "updatePas"){
    //                             // 修改密码
    //                             window.location.href = "/unit/unitPassword?id="+data.body.hzUnit.id;
    //                         }else{
    //                             window.location.href = "/unit/index";
    //                         } */
    //                     } else {
    //                         $("#loginspan").html(msg);
    //                         $("#loginspan").show();
    //                         changeCheckCode();//刷新验证码
    //                     }
    //
    //                 },
    //                 error: function () {
    //                     $("#loginspan").html("系统出错！");
    //                     $("#loginspan").show();
    //                     changeCheckCode();//刷新验证码
    //                 }
    //             })
    //
    //         }
    //
    //
    //     });
    // })
</script>


</body>
</html>